﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using nHydrate.Generator.Common.Util;

namespace nHydrate.Dsl
{
	partial class CompositeField
	{
		public override string ToString()
		{
			if (this.Composite == null)
			{
				return "Field";
			}
			else
			{
				var column = this.Composite.GetFields().FirstOrDefault(x => x.Id == this.FieldId);
				if (column == null)
				{
					return "Field";
				}
				else
				{
					return column.Name;
				}

			}
		}
	}
}
